package com.hustmm.controller;

import com.hustmed.domain.HardestSample;
import com.hustmm.domain.MmMaterial;
import com.hustmm.service.IHustMMStatisticsService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 材料数据Controller
 *
 */
@RestController
@RequestMapping("/hustmm/statistics")
public class HustMMStatisticsController extends BaseController
{
    @Autowired
    private IHustMMStatisticsService statisticsService;

    /**
     * 查询材料数据列表
     */

    @GetMapping("/personcount")
    public AjaxResult personcount()
    {
        int count = statisticsService.personcount();
        return AjaxResult.success(count);
    }


    @GetMapping("/matcount")
    public AjaxResult matcount()
    {
        int count = statisticsService.matcount();
        return AjaxResult.success(count);
    }


    @GetMapping("/processcount")
    public AjaxResult processcount()
    {
        int count = statisticsService.processcount();
        return AjaxResult.success(count);
    }


    @GetMapping("/expcount")
    public AjaxResult expcount()
    {
        int count = statisticsService.expcount();
        return AjaxResult.success(count);
    }


    @GetMapping("/samplecount")
    public AjaxResult samplecount()
    {
        int count = statisticsService.samplecount();
        return AjaxResult.success(count);
    }



    @GetMapping("/newMaterialList")
    public TableDataInfo newMaterialList()
    {
        List<MmMaterial> sampleList = statisticsService.newMaterialList();
        return getDataTable(sampleList);
    }

}
